package 第一章;

public class 题5将整数的奇偶位互换 {
    public static void main(String[] args) {
        int i=6;
        System.out.println(swap(i));
    }

    private static int swap(int i) {
            int ou = i&0xaaaaaaaa;
            int ji = i&0x55555555;
            return (ou>>1)^(ji<<1);
    }
}
